﻿<UserControl x:Class="PhoneyTools.Example.Views.ConvertersExamples"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
             xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:cvt="clr-namespace:AgiliTrain.PhoneyTools.Converters;assembly=AgiliTrain.PhoneyTools"
             FontFamily="{StaticResource PhoneFontFamilyNormal}"
             FontSize="{StaticResource PhoneFontSizeNormal}"
             Foreground="{StaticResource PhoneForegroundBrush}"
             mc:Ignorable="d"
             d:DesignHeight="768"
             d:DesignWidth="480"
             shell:SystemTray.IsVisible="True">
  <UserControl.Resources>
    <cvt:StringCaseConverter x:Key="stringCaseCvt" />
    <cvt:UnHtmlConverter x:Key="unHtmlCvt" />
    <cvt:DateTimeValueConverter x:Key="dateTimeCvt" />
    <cvt:MoneyConverter x:Key="moneyCvt" />
    <cvt:VisibilityConverter x:Key="visCvt" />
    <cvt:NullVisibilityConverter x:Key="nullVisibilityCvt" />
    <cvt:StringFormatConverter x:Key="formatCvt" />
  </UserControl.Resources>
  <!--LayoutRoot is the root grid where all page content is placed-->
  <Grid x:Name="LayoutRoot"
        Background="Transparent">
    <ScrollViewer Grid.Row="1"
                  Margin="12,0,12,0">
      <StackPanel x:Name="ContentPanel">
        <!-- Remove HTML Tags -->
        <TextBlock FontWeight="Bold"
                   Text="UnHtmlConverter" />
        <TextBlock Text="{Binding SomeHtml, 
                                  Converter={StaticResource unHtmlCvt}}" />
        <!-- To Lower Case -->
        <TextBlock FontWeight="Bold"
                   Text="StringCaseConverter - Lower Case" />
        <TextBlock Text="{Binding SomeText, 
                                  Converter={StaticResource stringCaseCvt}}" />
        <!-- To Upper Case -->
        <TextBlock FontWeight="Bold"
                   Text="StringCaseConverter - Upper Case" />
        <TextBlock Text="{Binding SomeText, 
                                  Converter={StaticResource stringCaseCvt}, 
                                  ConverterParameter=u}" />
        <!-- DateTimeConverter -->
        <TextBlock FontWeight="Bold"
                   Text="DateTimeConverter" />
        <TextBlock Text="{Binding SomeDate, 
                                  Converter={StaticResource dateTimeCvt}, 
                                  ConverterParameter=d}" />
        <!-- MoneyConverter -->
        <TextBlock FontWeight="Bold"
                   Text="MoneyConverter" />
        <TextBlock Text="{Binding SomeMoney, 
                                  Converter={StaticResource moneyCvt}}" />
        <!-- VisibilityConverter -->
        <TextBlock FontWeight="Bold"
                   Text="VisibiltyConverter" />
        <TextBlock Text="If You Can See This, it worked!"
                   Visibility="{Binding Visibility, 
                                        Converter={StaticResource visCvt}}" />
        <!-- NullVisibilityConverter -->
        <TextBlock FontWeight="Bold"
                   Text="NullVisibiltyConverter" />
        <TextBlock Text="If You Can See This, it worked!"
                   Visibility="{Binding SomeNull, 
                                        Converter={StaticResource nullVisibilityCvt}, 
                                        ConverterParameter=false}" />
        <!-- StringFormatConverter -->
        <TextBlock FontWeight="Bold"
                   Text="StringFormatConverter" />
        <TextBlock Text="{Binding SomeDouble,
                                  Converter={StaticResource formatCvt}, 
                                  ConverterParameter='00.00'}" />
      </StackPanel>
    </ScrollViewer>
  </Grid>
</UserControl>
